﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Interactivity;
using ConferenceClass = VideoChatClient.VideoChatClientViewModel.ConferenceClass;

namespace VideoChatClient.Behaviors
{


    internal sealed class RaiseCallEventAction : TriggerAction<DependencyObject>
    {

        public ConferenceClass TargetConferenceClass
        {
            get { return (ConferenceClass)GetValue(TargetConferenceClassProperty); }
            set { SetValue(TargetConferenceClassProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TargetConferenceClass.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TargetConferenceClassProperty =
            DependencyProperty.Register("TargetConferenceClass", typeof(ConferenceClass), typeof(RaiseCallEventAction));

        

        protected override void Invoke(object parameter)
        {
            if (TargetConferenceClass != null)
            {
                TargetConferenceClass.ReqConnect = true;
            }
        }
    }
    internal sealed class RaiseCancelEventAction : TriggerAction<DependencyObject>
    {

        public ConferenceClass TargetConferenceClass
        {
            get { return (ConferenceClass)GetValue(TargetConferenceClassProperty); }
            set { SetValue(TargetConferenceClassProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TargetConferenceClass.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TargetConferenceClassProperty =
            DependencyProperty.Register("TargetConferenceClass", typeof(ConferenceClass), typeof(RaiseCancelEventAction));

        protected override void Invoke(object parameter)
        {
            if (TargetConferenceClass != null)
            {
                TargetConferenceClass.IsNotAnswer = true;
            }
        }
    }
    internal sealed class RaiseAcceptEventAction : TriggerAction<DependencyObject>
    {
        public ConferenceClass TargetConferenceClass
        {
            get { return (ConferenceClass)GetValue(TargetConferenceClassProperty); }
            set { SetValue(TargetConferenceClassProperty, value); }
        }

        // Using a DependencyProperty as the backing store for TargetConferenceClass.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TargetConferenceClassProperty =
            DependencyProperty.Register("TargetConferenceClass", typeof(ConferenceClass), typeof(RaiseAcceptEventAction));

        protected override void Invoke(object parameter)
        {
            if (TargetConferenceClass != null)
            {
                TargetConferenceClass.IsAnswer = true;
            }
        }
    }
}